﻿using MediatR;
using RBAC.MaHaiBo.API.Application.Command.MenuCommand;
using RBAC.MaHaiBo.Service;

namespace RBAC.MaHaiBo.API.Application.CommandHandlers.MenuHandler
{
    public class MenuCountCommandHandler:IRequestHandler<MenuCountCommand,int>
    {
        /// <summary>
        /// 菜单服务层接口
        /// </summary>
        IMenuService mSer;
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="urSer"></param>
        public MenuCountCommandHandler(IMenuService mSer)
        {
            this.mSer = mSer;
        }

        public async Task<int> Handle(MenuCountCommand request, CancellationToken cancellationToken)
        {
           return await mSer.MenuCount(request.Mid);
        }
    }
}
